<!DOCTYPE html>
<html prefix="
og: http://ogp.me/ns#
article: http://ogp.me/ns/article#
" lang="zh_cn">
<head>
<meta charset="utf-8">
<meta name="description" content="hello.py">
<meta name="viewport" content="width=device-width">
<title>hello.py | vincent blog</title>
<link href="../assets/css/all-nocdn.css" rel="stylesheet" type="text/css">
<link rel="alternate" type="application/rss+xml" title="RSS" href="../rss.xml">
<link rel="canonical" href="https://wisonwang.github.io/listings/hello.py.html">
<!--[if lt IE 9]><script src="/assets/js/html5.js"></script><![endif]-->
</head>
<body>
    <section class="social"><ul>
<li><a href="../index.html" title="Home"><i class="icon-home"></i></a></li>
            <li><a href="../archive.html" title="文章存档"><i class="icon-archive"></i></a></li>
            <li><a href="../categories/" title="标签"><i class="icon-tags"></i></a></li>
            <li><a href="../pages/about" title="About"><i class="icon-about"></i></a></li>
            <li><a href="../rss.xml" title="RSS 源"><i class="icon-rss"></i></a></li>
            <li><a href="https://twitter.com/wisonwang" title="My Twitter"><i class="icon-twitter"></i></a></li>
            <li><a href="https://github.com/wisonwang" title="My Github"><i class="icon-github"></i></a></li>

        </ul></section><section class="page-content"><div class="content" rel="main">
<nav class="breadcrumbs"><ul class="breadcrumb">
<li><a href=".">listings</a></li>
                <li>hello.py</li>
</ul></nav><h1>hello.py
            <small><a href="hello.py">(源代码)</a></small>
        </h1>
    <table class="codetable"><tr>
<td class="linenos"><div class="linenodiv"><pre><a href="#listingshellopy-1"> 1</a>
<a href="#listingshellopy-2"> 2</a>
<a href="#listingshellopy-3"> 3</a>
<a href="#listingshellopy-4"> 4</a>
<a href="#listingshellopy-5"> 5</a>
<a href="#listingshellopy-6"> 6</a>
<a href="#listingshellopy-7"> 7</a>
<a href="#listingshellopy-8"> 8</a>
<a href="#listingshellopy-9"> 9</a>
<a href="#listingshellopy-10">10</a>
<a href="#listingshellopy-11">11</a>
<a href="#listingshellopy-12">12</a></pre></div></td>
<td class="code"><pre class="code literal-block"><a name="listingshellopy-1"></a><span class="ch">#!/usr/bin/python</span>
<a name="listingshellopy-2"></a>
<a name="listingshellopy-3"></a><span class="kn">import</span> <span class="nn">sys</span>
<a name="listingshellopy-4"></a>
<a name="listingshellopy-5"></a>
<a name="listingshellopy-6"></a><span class="k">def</span> <span class="nf">hello</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s1">'world'</span><span class="p">):</span>
<a name="listingshellopy-7"></a>    <span class="n">greeting</span> <span class="o">=</span> <span class="s2">"hello "</span> <span class="o">+</span> <span class="n">name</span>
<a name="listingshellopy-8"></a>    <span class="nb">print</span><span class="p">(</span><span class="n">greeting</span><span class="p">)</span>
<a name="listingshellopy-9"></a>
<a name="listingshellopy-10"></a>
<a name="listingshellopy-11"></a><span class="k">if</span> <span class="vm">__name__</span> <span class="o">==</span> <span class="s2">"__main__"</span><span class="p">:</span>
<a name="listingshellopy-12"></a>    <span class="n">hello</span><span class="p">(</span><span class="o">*</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">[</span><span class="mi">1</span><span class="p">:])</span>
</pre></td>
</tr></table>
<footer id="footer"><p>Contents © 2020         <a href="mailto:fangfu2012@gmail.com">vincent wang</a> - Powered by         <a href="https://getnikola.com" rel="nofollow">Nikola</a>         </p>
            
        </footer>
</div>
    </section><script src="../assets/js/all-nocdn.js" type="text/javascript"></script><script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> </script><script type="text/x-mathjax-config">
    MathJax.Hub.Config({tex2jax: {inlineMath: [['$latex ','$'], ['\\(','\\)']]}});
    </script><script type="text/javascript">
            $(function(){
                $('.timeago').timeago();
            });
        </script>
</body>
</html>
